Brain data#

This section presents results of brain MRI data. Below are quantitative T1 values computed using the MP2RAGE and the MTsat methods. These values are averaged within the gray matter and white matter masks.

Code imports#

# Python imports 
from IPython.display import clear_output
from pathlib import Path
import numpy as np

import pandas as pd
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 1000)
pd.set_option('display.colheader_justify', 'center')
pd.set_option('display.precision', 1)

# Import custom tools
from tools.data import Data
from tools.plot import Plot
from tools.stats import Stats

Download data#

data_type = 'brain'
release_version = 'latest'

dataset = Data(data_type)
dataset.download(release_version)
--2023-01-11 03:30:43--  https://github.com/courtois-neuromod/anat-processing/releases/download/r20220921/neuromod-anat-brain-qmri.zip
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 
302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/59a68bb3-4423-49ab-959d-247690acbebc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230111T033043Z&X-Amz-Expires=300&X-Amz-Signature=39b5779099208b95341ffdd08abd791e4aba1d885a379d78a805f7b055901252&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dneuromod-anat-brain-qmri.zip&response-content-type=application%2Foctet-stream [following]
--2023-01-11 03:30:43--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/59a68bb3-4423-49ab-959d-247690acbebc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230111T033043Z&X-Amz-Expires=300&X-Amz-Signature=39b5779099208b95341ffdd08abd791e4aba1d885a379d78a805f7b055901252&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dneuromod-anat-brain-qmri.zip&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 
Archive:  neuromod-anat-brain-qmri.zip
  inflating: data/brain/neuromod-anat-brain.nextflow.log  
  inflating: data/brain/results-neuromod-anat-brain-qmri.csv  
  inflating: data/brain/._results-neuromod-anat-brain-qmri.csv  
  inflating: data/brain/dag.dot      
  inflating: data/brain/report.html  
  inflating: data/brain/dag.png      
200 OK
Length: 1301347 (1.2M) [application/octet-stream]
Saving to: ‘neuromod-anat-brain-qmri.zip’

     0K .......... .......... .......... .......... ..........  3% 16.9M 0s
    50K .......... .......... .......... .......... ..........  7% 28.7M 0s
   100K .......... .......... .......... .......... .......... 11% 29.5M 0s
   150K .......... .......... .......... .......... .......... 15% 91.3M 0s
   200K .......... .......... .......... .......... .......... 19%  109M 0s
   250K .......... .......... .......... .......... .......... 23%  216M 0s
   300K .......... .......... .......... .......... .......... 27% 11.7M 0s
   350K .......... .......... .......... .......... .......... 31% 74.8M 0s
   400K .......... .......... .......... .......... .......... 35% 93.5M 0s
   450K .......... .......... .......... .......... .......... 39%  132M 0s
   500K .......... .......... .......... .......... .......... 43%  136M 0s
   550K .......... .......... .......... .......... .......... 47%  862K 0s
   600K .......... .......... .......... .......... .......... 51% 31.5M 0s
   650K .......... .......... .......... .......... .......... 55%  231M 0s
   700K .......... .......... .......... .......... .......... 59%  253M 0s
   750K .......... .......... .......... .......... .......... 62%  158M 0s
   800K .......... .......... .......... .......... .......... 66% 86.8M 0s
   850K .......... .......... .......... .......... .......... 70% 67.9M 0s
   900K .......... .......... .......... .......... .......... 74%  200M 0s
   950K .......... .......... .......... .......... .......... 78%  179M 0s
  1000K .......... .......... .......... .......... .......... 82%  165M 0s
  1050K .......... .......... .......... .......... .......... 86%  161M 0s
  1100K .......... .......... .......... .......... .......... 90%  302M 0s
  1150K .......... .......... .......... .......... .......... 94%  210M 0s
  1200K .......... .......... .......... .......... .......... 98%  296M 0s
  1250K .......... ..........                                 100%  173M=0.08s

2023-01-11 03:30:43 (16.2 MB/s) - ‘neuromod-anat-brain-qmri.zip’ saved [1301347/1301347]

Load data plot it#

qMRI Metrics#

dataset.load()
fig_gm = Plot(dataset, plot_name = 'brain-1')

fig_gm.title = 'Brain qMRI microstructure measures'
# If you're running this notebook in a Jupyter Notebook (eg, on MyBinder), change 'jupyter-book' to 'notebook'
fig_gm.display('jupyter-book')

Statistics#

White Matter#

stats_wm = Stats(dataset)
stats_wm.build_df('WM')
stats_wm.build_stats_table()
display(stats_wm.stats_table)
T1 (MP2RAGE) T1 (MTsat) MTR MTsat
intrasubject COV mean [%] 0.6 2.3 0.6 1.7
intrasubject COV std [%] 0.2 0.8 0.1 0.5
intersubject mean COV [%] 1.9 3.5 0.4 2.2

Grey Matter#

stats_gm = Stats(dataset)
stats_gm.build_df('GM')
stats_gm.build_stats_table()
display(stats_gm.stats_table)
T1 (MP2RAGE) T1 (MTsat) MTR MTsat
intrasubject COV mean [%] 0.4 3.1 0.8 2.7
intrasubject COV std [%] 0.1 1.6 0.2 1.2
intersubject mean COV [%] 1.0 5.7 1.2 4.5

Diffusion Tracts#

data_type = 'brain-diffusion'
release_version = 'latest'

dataset = Data(data_type)
dataset.download(release_version)
--2023-01-11 03:30:45--  https://github.com/courtois-neuromod/anat-processing/releases/download/r20220921b/brain-diffusion-arnaud.zip
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 
Archive:  brain-diffusion-arnaud.zip
  inflating: data/brain-diffusion/mean_std.json  
  inflating: data/brain-diffusion/._mean_std.json  
  inflating: data/brain-diffusion/volumes.json  
  inflating: data/brain-diffusion/._volumes.json  
302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/db2be019-9644-4ff2-8c70-c2d5347090b0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230111T033046Z&X-Amz-Expires=300&X-Amz-Signature=1290ddada0b123d0f813f71581992dd8ce5b75768c5714e5c591bd551480c340&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dbrain-diffusion-arnaud.zip&response-content-type=application%2Foctet-stream [following]
--2023-01-11 03:30:46--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/db2be019-9644-4ff2-8c70-c2d5347090b0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230111T033046Z&X-Amz-Expires=300&X-Amz-Signature=1290ddada0b123d0f813f71581992dd8ce5b75768c5714e5c591bd551480c340&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dbrain-diffusion-arnaud.zip&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 192601 (188K) [application/octet-stream]
Saving to: ‘brain-diffusion-arnaud.zip’

     0K .......... .......... .......... .......... .......... 26% 61.7M 0s
    50K .......... .......... .......... .......... .......... 53% 34.1M 0s
   100K .......... .......... .......... .......... .......... 79% 42.9M 0s
   150K .......... .......... .......... ........             100% 95.4M=0.004s

2023-01-11 03:30:46 (49.0 MB/s) - ‘brain-diffusion-arnaud.zip’ saved [192601/192601]
dataset.load()

fig_diff = Plot(dataset, plot_name = 'brain-diff')

fig_diff.title = 'Brain qMRI diffusion measures'

fig_diff.display('jupyter-book')

Statistics#

stats_cc1 = Stats(dataset)
stats_cc1.build_df('CC_1')
stats_cc1.build_stats_table()
display(stats_cc1.stats_table)
FA (DWI) MD (DWI) RD (DWI)
intrasubject COV mean [%] 1.0 0.8 1.1
intrasubject COV std [%] 0.3 0.7 0.5
intersubject mean COV [%] 4.1 2.2 4.1
stats_mcp = Stats(dataset)
stats_mcp.build_df('MCP')
stats_mcp.build_stats_table()
display(stats_mcp.stats_table)
FA (DWI) MD (DWI) RD (DWI)
intrasubject COV mean [%] 1.1 1.0 1.6
intrasubject COV std [%] 0.4 0.3 0.4
intersubject mean COV [%] 6.7 2.4 6.3

Diffusion - Corpus Callosum#

data_type = 'brain-diffusion-cc'
release_version = 'latest'

dataset = Data(data_type)
dataset.download(release_version)
--2023-01-11 03:31:05--  https://github.com/courtois-neuromod/anat-processing/releases/download/r20230110/brain-diffusion-cc.zip
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 
Archive:  brain-diffusion-cc.zip
  inflating: data/brain-diffusion-cc/labels.py  
  inflating: data/brain-diffusion-cc/._labels.py  
  inflating: data/brain-diffusion-cc/.DS_Store  
  inflating: data/brain-diffusion-cc/._.DS_Store  
  inflating: data/brain-diffusion-cc/labels.ipynb  
  inflating: data/brain-diffusion-cc/._labels.ipynb  
  inflating: data/brain-diffusion-cc/corpus_callosum-metrics.csv  
  inflating: data/brain-diffusion-cc/._corpus_callosum-metrics.csv  
302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/6e6dd34d-c009-4079-bea8-df5eea106c89?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230111T033105Z&X-Amz-Expires=300&X-Amz-Signature=4917acb0a9f0318e26e42a493f22628c0d8a32009e6606e8a7416acc7adea817&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dbrain-diffusion-cc.zip&response-content-type=application%2Foctet-stream [following]
--2023-01-11 03:31:06--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/6e6dd34d-c009-4079-bea8-df5eea106c89?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230111%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230111T033105Z&X-Amz-Expires=300&X-Amz-Signature=4917acb0a9f0318e26e42a493f22628c0d8a32009e6606e8a7416acc7adea817&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dbrain-diffusion-cc.zip&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15248 (15K) [application/octet-stream]
Saving to: ‘brain-diffusion-cc.zip’

     0K .......... ....                                       100% 48.2M=0s

2023-01-11 03:31:06 (48.2 MB/s) - ‘brain-diffusion-cc.zip’ saved [15248/15248]
dataset.load()

fig_diff = Plot(dataset, plot_name = 'brain-diff-cc')

fig_diff.title = 'Brain qMRI diffusion measures - corpus callosum'

fig_diff.display('jupyter-book')

Statistics#

stats_cc1 = Stats(dataset)
stats_cc1.build_df('genu')
stats_cc1.build_stats_table()
display(stats_cc1.stats_table)
FA (DWI) MD (DWI) RD (DWI)
intrasubject COV mean [%] 0.8 1.0 1.3
intrasubject COV std [%] 0.3 0.6 0.6
intersubject mean COV [%] 4.2 6.2 10.3
stats_cc1 = Stats(dataset)
stats_cc1.build_df('body')
stats_cc1.build_stats_table()
display(stats_cc1.stats_table)
FA (DWI) MD (DWI) RD (DWI)
intrasubject COV mean [%] 0.6 0.7 0.7
intrasubject COV std [%] 0.2 0.2 0.3
intersubject mean COV [%] 3.8 3.0 6.2
stats_cc1 = Stats(dataset)
stats_cc1.build_df('splenium')
stats_cc1.build_stats_table()
display(stats_cc1.stats_table)
FA (DWI) MD (DWI) RD (DWI)
intrasubject COV mean [%] 0.6 0.7 0.8
intrasubject COV std [%] 0.1 0.2 0.3
intersubject mean COV [%] 2.6 3.1 6.3